This invention relates to video data coding device and method for compression-coding source video data in accordance with the coding difficulty, a video data recording medium for recording coded data obtained by the device and method, and a video data transmitting device for coding video data by using a source video data coding device and transmitting the coded video data.
Recently, in order to carry out compression coding of source video data, a technique based on the MPEG (Moving Picture Experts Group) or MPEG2 standard employing motion compensation (MC) in combination with redundancy reduction processing by orthogonal transform such as discrete cosine transform (DCT) has been broadly used.
This MPEG technique is used for a storage system for compression-coding each group of pictures (GOP) as a unit consisting of an intra-picture (I-picture), a predictive-picture (P-picture) and a bidirectionally predictive-picture (B-picture) and recording the compressed data onto a recording medium such as a digital disk (for example, a magneto-optical (MO) disk). The MPEG technique is also used for an authoring system for recording compressed data onto a master disk.
In such storage system and authoring system, the storage capacity of the recording medium is limited, and therefore, the quantity of data (bits) of compressed data after compression coding must be made not greater than the storage capacity of the recording medium while high quality of image after expansion decoding is maintained.
The present Assignee has proposed a technique, referred to as xe2x80x9ctwo-pass encodexe2x80x9d, for temporarily encoding a video signal input by a fixed quantization value, then collecting data such as the quantity of generated bits, and from the result thereof, determining allocation (target quantity of codes) of the bit rate in variable rate encoding at the time of regular encoding. This two-pass encode system is an encoding method for optimally allocating bits to video data to be coded, in accordance with the coding difficulty of video images.
FIG. 1 is a conceptual view showing an entire two-pass encode system which is used in a DVD authoring system for recording coded video data onto a digital video disk (DVD) or a storage system for recording coded video data onto an MO disk.
In this two-pass encode system, in the first pass, a video signal input (Video Input) is preliminarily compression-coded by an encoder of fixed quantization to estimate the quantity of generated bits after compression coding as coding difficulty, and this estimated quantity of generated bits is supplied to an external computer. Then, the external computer supplies the target quantity of codes based on the quantity of generated bits, that is, the coding difficulty, to the encoder. In the second pass, the encoder carries out encoding in accordance with the target quantity of codes, and outputs a bit stream, which is coded data.
The two-pass encode system provides a satisfactory encode effect in terms of picture quality. However, from the viewpoint of operation efficiency, since encode operation must be carried out at least twice, there is such a problem that a long encode time is required.
Also, in the storage system for recording coded video data by using an optical disk or a tape streamer in place of VTR, encode processing needs to be carried out in real time. Therefore, in such a storage system with the conventional technique, only encoding at a fixed coding rate can be carried out regardless of the picture quality of video data to be coded.
In short, the conventional authoring system or storage system has such a problem that it is impossible to code source video data in real time while improving the picture quality of coded video data to be recorded on a storage medium.
Meanwhile, this MPEG technique is also used in a transmission system of digital broadcast for transmitting picture data as digital data. The advantage of digital broadcast is that a greater quantity of program data (hereinafter referred to as programs) than in analog broadcast can be transmitted on the same transmission line. In compression coding of a picture in this transmission system of digital broadcast, it is necessary to maintain high picture quality while restraining the quantity of data (bits) after compression coding to not more than the transmission capacity of the transmission line, similarly to the case of the storage system or authoring system. In the conventional transmission system, a xe2x80x9cstatistical multiplexingxe2x80x9d method is employed as a method for transmitting a greater quantity of programs to a transmission line of a predetermined transmission capacity. Statistical multiplexing is a method for allocating an optimum transmission rate to each program by dynamically changing the transmission rate of each program in accordance with the contents of the program. This statistical multiplexing is adapted for reducing the transmission rate with respect to a program having video data of simple patterns which do not require a large quantity of bits in coding, and increasing the transmission rate with respect to a program having video data of complex patterns which require a large quantity of bits in coding.
In such a transmission system of digital broadcast, live video programs such as sports programs and news programs must be transmitted in real time. However, the above-described two-pass encode system has such a problem that live video programs cannot be transmitted in real time, unless the video programs are transmitted at a fixed coding rate ignoring the picture quality. In short, in the conventional transmission system, programs of high picture quality cannot be transmitted in real time.
In view of the foregoing status of the art, it is an object of the present invention to provide video data coding device and method for carrying out, in real time, variable rate coding for realizing good picture quality, and a recording medium for coded data. Also, it is another object of the present invention to provide a video data transmitting device for transimnitting, in real time, data compression-coded by variable rate coding processing for realizing good picture quality.
In order to solve the above-described problem, in a video data coding device according to the present invention, a target quantity of codes to be distributed to input video data is calculated on the basis of index data indexing characteristics of the input video data, and in accordance with the target quantity of codes, coding processing is carried out on the input video data delayed by delay means.
That is, according to the present invention, there is provided a video data coding device for coding input video data supplied thereto, the device including: target quantity of codes calculation means for calculating a target quantity of codes to be distributed to the input video data on the basis of index data indexing characteristics of the input video data; delay means for delaying the input video data by a predetermined time period; and coding processing means for carrying out coding processing in accordance with the target quantity of codes with respect to the input video data delayed by the delay means.
In this case, the time period by which the delay means delays the input video data is a predetermined time period longer than a time period during which the target quantity of codes calculation means calculates the target quantity of codes. Consequently, the index data is precedently read. This precedent reading is carried out, for example, within 0.5 seconds of one GOP.
The target quantity of codes calculation means finds a coding difficulty indicating the difficulty at the time of coding from the index data, and calculates the target quantity of codes to be distributed to the video data on the basis of the coding difficulty.
Also, the target quantity of codes calculation means updates, at any time, the corresponding relation of the target quantity of codes based on the coding difficulty, in accordance with coding difficulties that have already been collected and the quantity of codes generated by the coding processing means.
In order to solve the above-described problem, in a video data coding method according to the present invention, a target quantity of codes to be distributed to input video data is calculated on the basis of index data indexing characteristics of the input video data, and in accordance with the target quantity of codes, coding processing is carried out on the input video data delayed at a delay step.
That is, according to the present invention, there is also provided a video data coding method for coding supplied input video data, the method including: a target quantity of codes calculation step of calculating a target quantity of codes to be distributed to the input video data on the basis of index data indexing characteristics of the input video data; a delay step of delaying the input video data by a predetermined time period; and a coding processing step of carrying out coding processing in accordance with the target quantity of codes with respect to the input video data delayed at the delay step.
In this case, the time period by which the input video data is delayed at the delay step is a predetermined time period longer than a time period during which the target quantity of codes is calculated at the target quantity of codes calculation step. Consequently, the index data is precedently read. This precedent reading is carried out, for example, within 0.5 seconds of one GOP.
At the target quantity of codes calculation step, a coding difficulty indicating the difficulty at the time of coding is found from the index data, and the target quantity of codes to be distributed to the video data is calculated on the basis of the coding difficulty.
Also, at the target quantity of codes calculation step, the corresponding relation of the target quantity of codes based on the coding difficulty is updated at any time, in accordance with coding difficulties that have already been collected and the quantity of codes generated at the coding processing step.
In the video data coding device of the present invention, a coding preprocessing section supplies, to a CPU, a statistic quantity (index data) indicating characteristics of source video data to be coded. The CPU calculates a coding difficulty indicating the difficulty in coding the video data, on the basis of the statistic quantity, and calculates a target quantity of codes allocated to each picture of the video data, on the basis of the coding difficulty. In addition, the CPU feeds forward the calculated target quantity of codes to an encoder, thereby enabling coding processing in real time without carrying out encode processing twice as in the conventional two-pass encode processing. Moreover, in the video data coding device of the present invention, since the target quantity of codes in accordance with the coding difficulty of video data is calculated, optimum coding in accordance with the pattern of video data can be realized.
In the video data coding device and method of the present invention, the CPU calculates a coding difficulty Dj indicating the coding difficulty in coding source video data from the source video data to be coded itself, and calculates a target quantity of codes Tj used in coding the source video data to be coded, on the basis of the calculated coding difficulty. Then, the CPU supplies the calculated target quantity of codes Tj to an encoder in a manner of feed forward, thereby enabling coding based on the target quantity of codes in accordance with the pattern of the source video data to be coded and also enabling coding of the video data in real time.
In addition, in the video data coding device of the present invention, since the coding difficulty is proximately calculated for each picture type by using intra-AC or ME residual found from the source video data to be coded, the coding difficulty can be obtained before the video data to be coded is actually encoded. Therefore, real-time coding processing can be realized.
Moreover, in the video data coding device of the present invention, if the picture type of video data to be coded is I-picture, the coding difficulty is calculated from intra-AC, whereas if the picture type of video data to be coded is P-picture or B-picture, the coding difficulty is calculated from ME residual. Thus, the coding difficulty with high precision can be calculated in accordance with the picture type.
In addition, in the video data coding device of the present invention, since a conversion formula for calculating the target quantity of codes from the calculated coding difficulty is corrected at any time on the basis of the actually generated coding quantity as a result of the past coding processing by coding means, the target quantity of codes adapted to a change of pattern of video data and target coding corresponding to the remaining quantity of a storage medium can be set. Furthermore, as the conversion formula for calculating the target quantity of codes from the coding difficulty, different conversion formulas are set in accordance with the picture type of the video data to be coded. Therefore, the optimum coding difficulty can be calculated not only on the GOP basis but also on the picture basis.
Moreover, in the video data coding device of the present invention, the operation expression for calculating the coding difficulty is updated at any time on the basis of global complexity found from the quantity of generated codes and the quantization value of coding processing by coding means. Therefore, the coding difficulty in accordance with a change of pattern of video data can be detected with higher precision.
In addition, in the video data coding device of the present invention, the CPU calculates, for each picture, coding difficulties related to a plurality of pictures included in a reference GOP to be a target of coding processing by coding means, and calculates the target quantity of codes allocated to the reference GOP from the plurality of coding difficulties calculated by coding difficulty calculation means. The CPU distributes the target quantity of codes allocated to the reference GOP, to each picture included in the reference GOP in accordance with the picture type, thereby calculating the target quantity of codes corresponding to each picture included in the reference GOP. Thus, different target quantities of codes in accordance with the picture type can be allocated to the respective pictures while an average quantity of codes designated to the GOP is maintained within the GOP.
According to the present invention, there is also provided a video data transmitting device for coding input video data supplied thereto and transmitting the coded video data, the device including: target quantity of codes calculation means for calculating a target quantity of codes to be distributed to the input video data on the basis of index data indexing characteristics of the input video data; delay means for delaying the input video data by a predetermined time period; and coding transmission means for carrying out coding processing in accordance with the target quantity of codes with respect to the input video data delayed by the delay means and transmitting the coded video data.
According to the present invention, there is also provided a video data transmitting device for coding source video data and transmitting the coded video data, the device including: coding difficulty calculation means for calculating a coding difficulty indicating the coding difficulty in coding the source video data; target quantity of codes calculation means for updating, at any time, an operation expression for calculating a target quantity of codes used in coding the source video data from the calculated coding difficulty, on the basis of the quantity of generated codes in the past coding processing, and calculating the target quantity of codes from the coding difficulty on the basis of the updated conversion formula; coding means for feeding forward the target quantity of codes calculated by the target quantity of codes calculation means, thereby coding the source video data to be coded in real time on the basis of the target quantity of codes corresponding to the source video data to be coded; and transmission means for transmitting the video data coded by the coding means.
According to the present invention, there is further provided a video data recording medium in which coded data is recorded, the coded data being obtained by calculating a target quantity of codes to be distributed to input video data on the basis of index data indexing characteristics of the input video data, and then carrying out coding processing in accordance with the target quantity of codes with respect to the input video data delayed by a predetermined time period.